home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / ksplash / themeengine.h < prev   
Encoding:
C/C++ Source or Header  |  2005-09-10  |  2.3 KB  |  83 lines

  1. /***************************************************************************
  2.  *   Copyright Brian Ledbetter 2001-2003 <brian@shadowcom.net>             *
  3.  *   Copyright Ravikiran Rajagopal 2003  <ravi@kde.org>                    *
  4.  *                                                                         *
  5.  *   This program is free software; you can redistribute it and/or modify  *
  6.  *   it under the terms of the GNU General Public License (version 2) as   *
  7.  *   published by the Free Software Foundation. (The original KSplash/ML   *
  8.  *   codebase (upto version 0.95.3) is BSD-licensed.)                      *
  9.  *                                                                         *
  10.  ***************************************************************************/
  11.  
  12. #ifndef THEMEENGINE_H
  13. #define THEMEENGINE_H
  14.  
  15. #include <qstringlist.h>
  16. #include <qvbox.h>
  17. #include <qwidget.h>
  18.  
  19. #include <kdemacros.h>
  20.  
  21. class KConfig;
  22. class ObjKsTheme;
  23. class QMouseEvent;
  24.  
  25. /**
  26.  * @short The base for the ThemeEngine's configuration widget.
  27.  */
  28. class KDE_EXPORT ThemeEngineConfig: public QVBox
  29. {
  30.   Q_OBJECT
  31. public:
  32.  
  33.   ThemeEngineConfig( QWidget *p, KConfig *c )
  34.       :QVBox( p ), mConfig( c )
  35.   {}
  36.  
  37.   KConfig* config()const { return mConfig; }
  38.  
  39. public slots:
  40.   virtual void load() {}
  41.   virtual void save() {}
  42.  
  43. protected:
  44.   KConfig *mConfig;
  45. };
  46.  
  47. /**
  48.  * @short Base class for all theme engines. Member functions need to be
  49.  * overridden by derived classes in order to provide actual functionality.
  50.  */
  51. class KDE_EXPORT ThemeEngine: public QVBox
  52. {
  53.   Q_OBJECT
  54. public:
  55.   ThemeEngine( QWidget *parent, const char *name, const QStringList &args );
  56.   virtual ~ThemeEngine() = 0;
  57.   virtual const ThemeEngineConfig *config( QWidget *, KConfig * ) { return 0L; }
  58.   virtual ObjKsTheme *ksTheme() { return mTheme; }
  59.   virtual bool eventFilter( QObject* o, QEvent* e );
  60.  
  61. public slots:
  62.   virtual void slotUpdateProgress( int ) {}
  63.   virtual void slotUpdateSteps( int ) {}
  64.   virtual void slotSetText( const QString& ) {}
  65.   virtual void slotSetPixmap( const QString& ) {} // use DesktopIcon() to load this.
  66.  
  67. protected:
  68.   void addSplashWindow( QWidget* );
  69.  
  70. protected:
  71.   ObjKsTheme *mTheme;
  72.   virtual bool x11Event( XEvent* );
  73.  
  74. private slots:
  75.   void splashWindowDestroyed( QObject* );
  76.  
  77. private:
  78.   class ThemeEnginePrivate;
  79.   ThemeEnginePrivate *d;
  80. };
  81.  
  82. #endif
  83.